package com.example.chapter9;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		DipUtils dipUtils = DipUtils.getInstance();
		dipUtils.init(this);
		
		int pixel = dipUtils.DpToPixel(100);
		float dp = dipUtils.PixcelToDp(100);
		int xhdpi = dipUtils.fromExtraHighDiensityPixel(100);
		int hdpi = dipUtils.fromHighDiensityPixel(100);
		int mdpi = dipUtils.fromMediumDiensityPixel(100);
		int ldpi = dipUtils.fromLowDiensityPixel(100);
		
		Log.d("TEST", String.valueOf(pixel));
		Log.d("TEST", String.valueOf(dp));
		Log.d("TEST", String.valueOf(xhdpi));
		Log.d("TEST", String.valueOf(hdpi));
		Log.d("TEST", String.valueOf(mdpi));
		Log.d("TEST", String.valueOf(ldpi));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}
